<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">

<title>电子文档系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<script type="text/javascript" src="view/jquery/jquery-1.9.1.js"></script>
<script type="text/javascript" src="view/bootstrap/js/bootstrap.js"></script>
<link rel="stylesheet" href="view/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="view/css/docMan.css">
<link rel="stylesheet" href="view/css/font-awesome.min.css">
<link rel="stylesheet" href="view/css/buttons.css">
<link rel="stylesheet" href="view/toastr/toastr.css">
<script type="text/javascript" src="view/js/docMan.js"></script>
<script type="text/javascript" src="view/toastr/toastr.min.js"></script>
<script type="text/javascript" src="view/js/ajaxfileupload.js"></script>
</head>
<body style="background: #EDEFF0;">
	<div id="main-container" class="container"
		style="height: 100%;width:100%;background: #EDEFF0">
		<table class="table table-striped table-bordered">
			<thead>
				<tr style="width:100%;">
					<th style="width:3%;">序号</th>
					<th style="width:12%;cursor: pointer;" id="orderByTime" >时间<span <s:if test='danganPage.orderByTime=="desc"'>class="glyphicon glyphicon-arrow-down" </s:if><s:else>class="glyphicon glyphicon-arrow-up" </s:else> id="orderBtn" aria-hidden="true" style="margin-left:10px;"></span></th>
					<th style="width:15%">
						<div class="dropdown">
							来文单位
							<s:if test='isQtSearch==true'>
								<button class="btn btn-default dropdown-toggle" type="button"
									id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true"
									aria-expanded="true">
									<s:if test='isqtlwdw==false'>其他</s:if>
									<s:else><s:property value="qtLwdw" /></s:else>
									<span class="caret"></span>
								</button>
								<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
									<li class="qtlwdw" value="市级机关">市级机关</li>
									<li class="qtlwdw" value="宁波市人民政府">宁波市人民政府</li>
									<li class="qtlwdw" value="市委">市委</li>
									<li class="qtlwdw" value="县区级来文件">县区级来文件</li>
									<li class="qtlwdw" value="市政府承办单">市政府承办单</li>
									<li class="qtlwdw" value="省政府">省政府</li>
									<li class="qtlwdw" value="中央、中央办公厅">中央、中央办公厅</li>
									<li class="qtlwdw" value="省委">省委</li>
									<li class="qtlwdw" value="宁波市发展和改革委员会">宁波市发展和改革委员会</li>
									<li class="qtlwdw" value="国务院">国务院</li>
									<li class="qtlwdw" value="其他">其他</li>
								</ul>
							</s:if>
						</div>
					</th>
					<th style="width:14%;">来文编号</th>
					<th style="width:40%;">标题</th>
					<th style="width:10%;">操作</th>
				</tr>
			</thead>
			<tbody class="file_list">
				<s:iterator value="danganPage.result" id="file" status="stu">
					<tr style="width:100%;" >
						<td style="padding-left: 15px;">
							<s:property value="#stu.count " />
						</td>
						<td style="padding-left: 15px;"><span class=""><s:property
									value="#file.vlastdate" /> </span></td>
						<td><span class=""style="text-aglin:center;"><s:property value="#file.vlwdw" />
						</span></td>
						<td><span class=""><s:property value="#file.vlwbh"
									escape="false" /> </span></td>
						<td><span class=""><s:property value="#file.vlwbt"
									escape="false" /> </span></td>
						<td>
							<button type="button" id='<s:property value="#file.vrecid" />'
								class="btn btn-default btn_look_pdf" style="padding:3px 9px;">查看</button>
								<!-- type=1表示来自OA的 -->
								<a href="javascript:void(0)" id="<s:property value="#file.vrecid" />" type='1' class=" btn btn-default file_collect" style="font-size: 12px;color: #06c;padding:5px 10px;">收藏</a>
						</td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
		<!--分页按钮  -->
		  				<div class="row" style="margin-top: 20px;margin-bottom: 20px;">
		  					<form id="gwllForm" name="gwllForm" action="gwllSearch.action" method="get">
			  					<button class="btn btn-link prePage" <s:if test='danganPage.hasPrePage==false' >disabled="disabled"</s:if> >上一页</button>
	  							<input type="number" formtarget="gwllForm" onkeydown='if(event.keyCode==13){gosubmit();}' form="gwllForm" id="currentPage" name="danganPage.currentPage" value='<s:property value="danganPage.currentPage" />' style="width:80px;display: inline;" class="form-control">
	  							<%-- <input type="number" id="currentPage" name="danganPage.currentPage" value='<s:property value="danganPage.currentPage"/>' style="display: none;"> --%>
	  							<input id="totalPage" value='<s:property value="danganPage.totalPage" />' style="display: none;">
	  							<button class="btn btn-link nextPage" type="button" <s:if test='danganPage.hasNextPage==false' >disabled="disabled"</s:if>>下一页</button>
	  							共<span class="pageCount" ><s:property value="danganPage.totalPage"/> </span>页，<s:property value="danganPage.totalCount"/>条记录
		  						<input type="hidden" id="orderByTimeField" name="danganPage.orderByTime" value='<s:property value="danganPage.orderByTime" />'>
		  						<input type="hidden" id="isqtlwdw" name="isqtlwdw" value='<s:property value="isqtlwdw" />'>
		  						<input type="hidden" id="qtlwdw" name="qtLwdw" value='<s:property value="qtLwdw" />'>
		  					</form>
  						</div>
	</div>

			<div id="pdfModal" class="col-md-12 "
						style="z-index: 10000;position: absolute;min-height:700px;display: none;top:0px;left:15%;">
						<div class="modal-header" style="background: t;">
							<button type="button" class="close" data-dismiss="modal">
								<span aria-hidden="true" id="closePdf" class="bold">×</span><span
									class="sr-only">关闭</span>
							</button>
							<h4 id="fileName" class="modal-title center bold"></h4>
						</div>
						<iframe id="pdf" name="pdf" contextmenu="return false"
							scrolling="yes" src="" style="width:98%; ">
						</iframe>
				</div>
				<div id="pfdModal" class="modal fade">
					<div class="modal-dialog">
						<div class="modal-content">
							<div class="modal-body">
								<iframe id="pdfIframe" name="pdfIframe" contextmenu="return false"
									scrolling="yes" src=""
									style="width:100%;height: 100%;@media print{ body{display:none} } ">
								</iframe>
							</div>
							<div class="">
								<div class="row">
									<div class="" style="margin-left:45%;">
										<!-- <button type="button" class="btn btn-primary"
											data-dismiss="modal">返回</button> -->
											<button type="button" id="hidepdf" class="btn btn-primary"
											>返回</button>
										<!-- <button type="button" class="btn btn-danger print"
											>打印</button> -->
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
	<!--文件收藏的modal	  -->
	<div class="modal fade" id="collectFileModal" tabindex="-1"
		role="dialog" aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">文件收藏</h4>
				</div>
				<div class="modal-body">
					<span class="">请选择目标文件夹</span>
					<div class="row myDir_lists linktreeWrap margine_clear mt_10">
						<ul class="disk-copy-ul unstyled">
							<li><a href="javascript:void(0);" class="myFirstDir"
								id="${personalDirId}"> <i
									class="diskpic-copy-right mgtDiskListArrows"></i>
							</a> <span class="ch mgtActive"><i class="diskpic-smallbox"></i><span
									class="me-margin-left5">我的网盘</span></span></li>
						</ul>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" id="btn_collect" class="btn btn-primary">确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	var height = getWindowHieght() * 0.9;
	var width = getWindowWidth() * 0.6;
	$("#pdfModal").css("height", height);
	$("#pdfModal").css("width", width);
	$("#pdf").css("height", height);
	$("#pdf").css("width", width * 0.98);
	$("#closePdf").on("click", function() {
		$("#pdfModal").toggle(400);
	});
	$(".btn_look_pdf").on("click", function() {
		parent.hideleft();
		var id = $(this).attr("id");
		var url = "/DocMan/dowloadFile.action?indexFrom=1&id=" + id;
		/* $("#pdf").attr("src",url);
		$("#pdfModal").toggle(400); */
		var height = $(window).height()-50;
		var width = $(window).width();
		var pdf = $("#pfdModal");
		$("#pdfIframe").attr('src', url);
		$("#jnmlModal").modal('hide');
		pdf.find(".modal-body").css({
			height : height - 40
		});
		pdf.find(".modal-dialog").css({
			width : width,
			height : height,
			margin : 0
		});
		pdf.modal('show').css({
			width : width,
			height : height
		});
	});
	$("#hidepdf").on("click", function() {
		parent.showleft();
		$("#pfdModal").modal('hide');
	})
	$(".prePage").on("click", function() {
		var pageCount = Number($("#currentPage").val()) - 1;
		$("#currentPage").val(pageCount);
		$("#gwllForm").submit();
	});
	$(".nextPage").on("click", function() {
		var pageCount = Number($("#currentPage").val()) + 1;
		$("#currentPage").val(pageCount);
		console.info($("#currentPage").val());
		$("#gwllForm").submit();
	});
	function gosubmit() {
		$("#gwllForm").submit();
	}
	$("#orderByTime").on("click", function() {
		if ($("#orderBtn").hasClass("glyphicon-arrow-down")) {
			$("#orderByTimeField").val("asc");
		} else {
			$("#orderByTimeField").val("desc");
		}
		$("#gwllForm").submit();
	})
	$(".qtlwdw").on("click", function() {
		var qtlwdw = $(this).text();
		if (qtlwdw == "其他") {
			$("#isqtlwdw").val(false);
		} else {
			$("#isqtlwdw").val(true);
			$("#qtlwdw").val(qtlwdw);
			console.info(qtlwdw)
		}
		$("#gwllForm").submit();
	})
</script>
</html>
